package chaoyue.study.reflect;

import java.lang.reflect.Constructor;

/**
 * 反射机制与构造方法
 */
public class Test11 {
    public static void main(String[] args) throws Exception {
        Class clazz = Class.forName("chaoyue.study.reflect.bean.User");
        // 获取所有的构造方法
        Constructor[] constructors = clazz.getConstructors();
        for (Constructor constructor : constructors) {
            for (Class parameterType : constructor.getParameterTypes()) {
                System.out.print(parameterType.getSimpleName() + " ");
            }
            System.out.println();
        }
    }
}
